<!doctype html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>美女活动首页</title>

    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=640, user-scalable=no">

    <link rel="stylesheet" href="${resources}/css/details.css">
</head>
<body>
<div id="container">
    <div class="header">
        <a href="${path}/manage/vote/one" class="back"><img src="${resources}/vote/4_1.png">返回</a>
        <h3>有奖票选最美员工</h3>
    </div>

    <div class="con">
        <img class="photo" src="${emp.emp.picurl}">
        <div class="mes">
            <div class="mesRow">
                <img src="${resources}/vote/1_1.png">
                <span>姓名：</span>
                <span>${emp.emp.name}</span>
            </div>
            <div class="mesRow">
                <img src="${resources}/vote/1_2.png">
                <span>工号：</span>
                <span>${emp.emp.empNo}</span>
            </div>
            <div class="mesRow">
                <img src="${resources}/vote/1_3.png">
                <span>部门：</span>
                <span>${emp.emp.cooprt.name}</span>
            </div>
            <div class="mesRow">
                <img src="${resources}/vote/1_4.png">
                <span>排名：</span>
                <span>${emp.ranking}</span>
            </div>

            <button id="voteBtn" onclick="vote(${emp.emp.id})">为我投票</button>
        </div>
    </div>

    <div class="footer">
        <img src="${resources}/vote/4_15.png">
    </div>
</div>
<script src="${resources}/scripts/jquery-2.2.2.min.js"></script>
<script src="${resources}/scripts/common.js"></script>
<script type="text/javascript">
function vote(id){
   $.ajax({
          type: "GET",
          url: "${path}/manage/vote/vote/"+id,
          dataType: "json",
          success: function(data){
            		if(data.code==200){
            			 common.alert({
	        	   			  title:'系统提示',
	        	   			  content:'投票成功'
	        	   		 	 });
            		}else{
            			 common.alert({
	        	   			  title:'系统提示',
	        	   			  content:'没有投票机会了'
	        	   		 	 });
            		}
          	
          		}
           });
}
</script>
</body>
</html>